#ifndef AINTERPRETER_H
#define AINTERPRETER_H

#include <QObject>
#include "api.h"
#include "packet.h"
#include "protocol.h"

class AInterpreter : public QObject
{
	Q_OBJECT

public:
	AInterpreter(Api &api, QObject *parent = 0);
	~AInterpreter();
	typedef void(AInterpreter::*funcPtr)(Packet &);

protected:
	Api &					_api;
	byte					_proto;
	std::map<unsigned char, funcPtr> operatorsFunc;

public:
	bool					interpret(Packet &pkg);
	byte					getProto() const;
	byte					getOp(Packet &pkg) const;
};

#endif // AINTERPRETER_H
